<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./../../WEB-INF/templates/Template.xhtml">

            <ui:define name="content">
                <c:set var ="thanhvien" value="${admin_ProducerController.getSanPhamTemp()}" />

                <div class= "body-content" >

                    <div class ="right-cont">
                        <div id="contented">
                            <div class="bg_account_T">
                                Quản Lý Sản Phẩm
                            </div>
                            <div class="box-profile">
                                <fieldset>
                                    <legend>Thông Tin Sản Phẩm</legend>


                                    <h:form>
                                        <h:inputHidden value="#{admin_ProductController.sanPhamTemp.masanpham}"/>
                                        <div class="field">
                                            <label>Tên Sản Phẩm</label><h:inputText id="tenId" value="#{admin_ProductController.sanPhamTemp.tensanpham}" styleClass="f-input"
                                                                                 required="true"
                                                                                 requiredMessage="Vui lòng nhập tên"/>
                                            <h:message for="tenId" styleClass="error" /><br/>
                                        </div>
                                         <div class="field">
                                             <label>Loại Sản Phẩm</label><h:selectOneMenu id="loaiSanPhamId" value="#{admin_ProductController.sanPhamTemp.loaisanpham.tenloaisanpham}" styleClass="f-input">
                                                 <f:selectItems value="#{admin_ProductController.loaiSanPhams}"/>
                                             </h:selectOneMenu>
                                            <br/>
                                        </div>
                                         <div class="field">
                                             <label>Nhà Sản Xuất</label><h:selectOneMenu id="nhaSanXuatId" value="#{admin_ProductController.sanPhamTemp.nhasanxuat.tennhasanxuat}" styleClass="f-input" >
                                                 <f:selectItems value="#{admin_ProductController.nhaSanXuats}"/>
                                             </h:selectOneMenu>
                                            <br/>
                                        </div>
                                         <div class="field">
                                            <label>Xuất Xứ</label><h:inputText id="xuatXuId" value="#{admin_ProductController.sanPhamTemp.xuatxu}" styleClass="f-input"
                                                                                 />
                                            <br/>
                                        </div>
                                         <div class="field">
                                            <label>Giá Bán</label><h:inputText id="giaBanId" value="#{admin_ProductController.sanPhamTemp.giaban}" styleClass="f-input"
                                                                                 required="true"
                                                                                 requiredMessage="Vui lòng nhập giá bán"/>
                                            <h:message for="giaBanId" styleClass="error" /><br/>
                                        </div>
                                         <div class="field">
                                            <label>Số Lượt Xem</label><h:inputText id="soLuotXemId" value="#{admin_ProductController.sanPhamTemp.soluotxem}" styleClass="f-input"
                                                                                 required="true"
                                                                                 requiredMessage="Vui lòng nhập số lượt xem"/>
                                            <h:message for="soLuotXemId" styleClass="error" /><br/>
                                        </div>
                                         <div class="field">
                                            <label>Số Lượt Bán</label><h:inputText id="soLuotBanId" value="#{admin_ProductController.sanPhamTemp.soluotban}" styleClass="f-input"
                                                                                 required="true"
                                                                                 requiredMessage="Vui lòng nhập số lượt bán"/>
                                            <h:message for="soLuotBanId" styleClass="error" /><br/>
                                        </div>
                                         <div class="field">
                                            <label>Mô Tả</label><h:inputText id="moTaId" value="#{admin_ProductController.sanPhamTemp.mota}" styleClass="f-input"
                                                                                />
                                            <br/>
                                        </div>
                                       
                                        <h:commandButton value="Cập Nhật" action="#{admin_ProductController.UpdateProduct()}"/>
                                    </h:form>
                                </fieldset>
                            </div>
                        </div>
                    </div>
                </div>
            </ui:define>

        </ui:composition>

    </body>
</html>
